

"""
功能描述：维护搜索页面数据
"""
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from common.log import logger
from po.basePage import BasePage

class SearchPage(BasePage):
    # 点击ID
    search_box=(By.ID, "com.ss.android.article.news:id/bpb")
    # 输入ID
    input_box=(By.ID, "com.ss.android.article.news:id/w3")
    # 搜索ID
    search_but=(By.ID, "com.ss.android.article.news:id/w0")

    def clickSearchbox(self):
        # 点击搜索框
        self.by_find_element(*self.search_box).click()

    def inputSearchbox(self,data):
        # 输入搜索框
        self.by_find_element(*self.input_box).send_keys(data)

    def clickSearchbut(self):
        # 点击搜索按钮
        self.by_find_element(*self.search_but).click()

if __name__ == '__main__':
    from common.driver import Driver
    driver=Driver().startUp()
    SearchPage(driver).clickSearchbox()